
package com.productmodule.bean;

import java.io.Serializable;
import java.util.List;

import com.areamodule.bean.TbArea;
import com.areamodule.dao.TbAreaDAO;
import com.interfacemodule.bean.TbInterface;
import com.interfacemodule.dao.TbInterfaceDAO;
import com.producttypemodule.bean.TbProductType;
import com.producttypemodule.dao.TbProductTypeDAO;
import com.usersmodule.bean.TbUsers;
import com.usersmodule.dao.TbUsersDAO;

public class TbProduct implements Serializable{

    private int productId;

    private int productTypeId;
    /**
     * 添加对应外键对象1
     */
    private TbProductType tbProductType;

    private String productName;

    private String interfaceId;
    
    private List<TbInterface> tbInterfaceList;

    private String areaId;
    
    private List<TbArea> tbAreaList;
    
    private int userId;
    private TbUsers tbUser;

    private String productMemo;

    private String createTime;

    public int getProductId(){
        return productId;
    }

    public void setProductId(int productId){
        this.productId = productId;
    }

    public int getProductTypeId(){
        return productTypeId;
    }

    public void setProductTypeId(int productTypeId){
    	/**
    	 * 在设置中外键时调用dao方法3
    	 */
    	this.tbProductType=new TbProductTypeDAO().getTbProductTypeByProductTypeId(productTypeId);
        this.productTypeId = productTypeId;
    }
    /**
     * 为添加的外键对象设置set与get方法 2   
     * @return
     */
    public TbProductType getTbProductType() {
		return tbProductType;
	}
    /**
     * 为添加的外键对象设置set与get方法 2   
     * @return
     */
	public void setTbProductType(TbProductType tbProductType) {
		this.tbProductType = tbProductType;
	}

	public String getProductName(){
        return productName;
    }

    public void setProductName(String productName){
        this.productName = productName;
    }

    public String getInterfaceId(){
        return interfaceId;
    }

    public void setInterfaceId(String interfaceId){
    	this.tbInterfaceList=new TbInterfaceDAO().getTbInterfaceListByInterfaceId(interfaceId);
        this.interfaceId = interfaceId;
    }
    public List<TbInterface> getTbInterfaceList() {
		return tbInterfaceList;
	}

	public void setTbInterfaceList(List<TbInterface> tbInterfaceList) {
		this.tbInterfaceList = tbInterfaceList;
	}

	public String getAreaId(){
        return areaId;
    }

    public void setAreaId(String areaId){
    	this.tbAreaList = new TbAreaDAO().getTbAreaAll(areaId);
        this.areaId = areaId;
    }

    public int getUserId(){
        return userId;
    }

    public void setUserId(int userId){
    	this.tbUser=new TbUsersDAO().getTbUsersByUserId(userId);
        this.userId = userId;
    }
    
    public TbUsers getTbUser() {
		return tbUser;
	}

	public void setTbUser(TbUsers tbUser) {
		this.tbUser = tbUser;
	}

	public String getProductMemo(){
        return productMemo;
    }

    public void setProductMemo(String productMemo){
        this.productMemo = productMemo;
    }

    public String getCreateTime(){
        return createTime;
    }

    public void setCreateTime(String createTime){
        this.createTime = createTime;
    }

    public TbProduct(){
    }
        public TbProduct(int productTypeId,String productName,String interfaceId,String areaId,int userId,String productMemo,String createTime){
        this.productTypeId = productTypeId;
        this.productName = productName;
        this.interfaceId = interfaceId;
        this.areaId = areaId;
        this.userId = userId;
        this.productMemo = productMemo;
        this.createTime = createTime;
    }
    public TbProduct(int productId,int productTypeId,String productName,String interfaceId,String areaId,int userId,String productMemo,String createTime){
        this.productId = productId;
        this.productTypeId = productTypeId;
        this.productName = productName;
        this.interfaceId = interfaceId;
        this.areaId = areaId;
        this.userId = userId;
        this.productMemo = productMemo;
        this.createTime = createTime;
    }

	public List<TbArea> getTbAreaList() {
		return tbAreaList;
	}

	public void setTbAreaList(List<TbArea> tbAreaList) {
		this.tbAreaList = tbAreaList;
	}
}

